<include file="public/layout" />
<style>
.ncm-goods-gift {
	text-align: left;
}
.ncm-goods-gift ul {
    display: inline-block;
    font-size: 0;
    vertical-align: middle;
}
.ncm-goods-gift li {
    display: inline-block;
    letter-spacing: normal;
    margin-right: 4px;
    vertical-align: top;
    word-spacing: normal;
}
.ncm-goods-gift li a {
    background-color: #fff;
    display: table-cell;
    height: 30px;
    line-height: 0;
    overflow: hidden;
    text-align: center;
    vertical-align: middle;
    width: 30px;
}
.ncm-goods-gift li a img {
    max-height: 30px;
    max-width: 30px;
}

a.green{
	
	background: #fff none repeat scroll 0 0;
    border: 1px solid #f5f5f5;
    border-radius: 4px;
    color: #999;
    cursor: pointer !important;
    display: inline-block;
    font-size: 12px;
    font-weight: normal;
    height: 20px;
    letter-spacing: normal;
    line-height: 20px;
    margin: 0 5px 0 0;
    padding: 1px 6px;
    vertical-align: top;
}

a.green:hover { color: #FFF; background-color: #1BBC9D; border-color: #16A086; }

.ncap-order-style .ncap-order-details{
	margin:20px auto;
}
.contact-info h3,.contact-info .form_class{
  display: inline-block;
  vertical-align: middle;
}
.form_class i.fa{
  vertical-align: text-bottom;
}
</style>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="javascript:history.go(-1)" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
      <div class="subject">
        <h3>一元夺宝订单详情</h3>
        <h5>商城实物商品交易订单查询及管理</h5>
      </div>
      <div class="subject" style="width:62%">
	     <if condition="$order['order_status'] lt 2">
      		<a href="{:U('Admin/order/edit_order',array('order_id'=>$order['order_id']))}" style="float:right;margin-right:10px" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-pencil-square-o"></i>修改订单</a>
      	 </if>
      	 <if condition="($split eq 1) and ($order['order_status'] lt 2)">
      		<a href="{:U('Admin/order/split_order',array('order_id'=>$order['order_id']))}" style="float:right;margin-right:10px" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-external-link-square"></i>拆分订单</a>
      	 </if>
      	 <a href="{:U('Order/order_print',array('order_id'=>$order['order_id']))}" target="_blank" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="打印订单">
      	 <a href="{:U('Order/order_print',array('order_id'=>$order['order_id']))}" style="float:right;margin-right:10px" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-print"></i>打印订单</a>
      	 </a>	
      </div>
    </div>
      
  </div>
  <div class="ncap-order-style">
    <div class="titile">
      <h3></h3>
    </div>
 
    <div class="ncap-order-details">
      <form id="order-action">
        <div class="tabs-panels">
        <div class="misc-info">
           <h3>基本信息</h3>
           		<dl>
		            <dt>订单 ID：</dt>
		            <dd>{$order.id}</dd>
		            <dt>订单号：</dt>
		            <dd>{$order.order_sn}</dd>
		            <dt>参与者：</dt>
		            <dd>{$order.user.nickname}</dd>
		          </dl>
	              <dl>
	              	<dt>E-Mail：</dt>
		            <dd>{$order.user.email}</dd>
		            <dt>电话：</dt>
		            <dd>{$order.user.mobile}</dd>
			       </dl>
			       <dl>
	              	<dt>订单状态：</dt>
		            <dd>{$order_status[$order[order_status]]}</dd>
		            <dt>参与时间：</dt>
		            <dd>{$order.addtime|date='Y-m-d H:i',###}</dd>
		            <dt>支付时间：</dt>
		            <dd><if condition="$order.pay_time neq 0">{$order.pay_time|date='Y-m-d H:i',###}<else/>N</if></dd>
			       </dl>
			       <dl>
	              	<dt>支付方式：</dt>
		            <dd>{$order.pay_name|default='其他方式'}</dd>
		           </dl>
		           <dl>
	              	<dt>夺宝码：</dt>
		            <dd style="width: 800px"><foreach name='order.indiana_number' item='vo' key='k'><span style="margin-right: 10px;">{$vo}</span></foreach></dd>
		           </dl>
		           <dl>
	              	<dt>是否中奖：</dt>
		            <dd><if condition="$order.is_praise eq 1"><span style="color: green;">已中奖，本期开奖号码：{$order.indiana.win_number}</span><else/><span style="color: red;">未中奖,本期开奖号码：{$order.indiana.win_number}</span></if></dd>
		           </dl>
        	</div>
        
        <div class="addr-note">
          <h4>收货信息</h4>
          <dl>
            <dt>收货人：</dt>
            <dd>{$order.address.consignee}</dd>
            <dt>联系方式：</dt>
            <dd>{$order.address.mobile}</dd>
          </dl>
          <dl>
            <dt>收货地址：</dt>
            <dd>{$order.address.address}</dd>
          </dl>
          <dl>
            <dt>邮编：</dt>
            	<dd><if condition="$order.address.zipcode neq ''"> {$order.address.zipcode}<else/>N</if></dd>
          </dl>
          <dl>
           		<dt>配送方式：</dt>
            	<dd>{$order.shipping_info.shipping_name}</dd>
          	</dl>
          	<dl>
           		<dt>快递单号：</dt>
            	<dd>{$order.shipping_info.invoice_no}</dd>
          	</dl>
        </div>
  
         
        <div class="goods-info">
          <h4>活动信息</h4>
          <table>
            <thead>
              <tr>
                <th colspan="2">活动名称</th>
                <th>购买数量</th>
                <th>单品价格</th>
              </tr>
            </thead>
            <tbody>
           	<tr>
                <td class="w30"><div class="goods-thumb"><a href="{:U('Home/Goods/goodsInfo',array('id'=>$good['goods_id']))}" target="_blank"><img alt="" src="{$good['goods_id']|goods_thum_images=200,200}" /> </a></div></td>
                <td style="text-align: left;"><a href="{:U('Mobile/Goods/indianaInfo',array('id'=>$order['indiana_id']))}" target="_blank">{$order.indiana.title}</a><br/></td>
                <td class="w60">{$order.num}</td>
                <td class="w100">{$order.indiana.price}</td>
            </tr>
          </table>
        </div>
        <div class="total-amount contact-info">
          <h3>订单总额：￥{$order.indiana.price * $order.num}</h3>
        </div>
        <div class="contact-info">
          <h3>操作信息</h3>
          <dl class="row">
	        <dt class="tit">
	          <label for="note">操作备注</label>
	        </dt>
	        <dd class="opt" style="margin-left:10px">
	         <textarea id="note" name="note" style="width:600px" rows="6"  placeholder="请输入操作备注" class="tarea">{$keyword.text}</textarea>
	        </dd>
	      </dl> 
	      <dl class="row">
	        <dt class="tit">
	          <label for="note">可执行操作</label>
	        </dt>
	        <dd class="opt" style="margin-left:10px">
	         	<foreach name="button" item="vo" key="k">
               		<if condition="$k eq 'delivery'">                                                
               		<a class="ncap-btn-big ncap-btn-green" href="{:U('Order/indiana_delivery_info',array('id'=>$order['id']))}">{$vo}</a>
               		<else>
               		<a class="ncap-btn-big ncap-btn-green" onclick="ajax_submit_form('order-action','{:U('Admin/order/indiana_order_action',array('id'=>$order['id'],'type'=>$k))}');" >
               		{$vo}</a>
               		</else>
               		</if>
               	</foreach>
	        </dd>
	      </dl> 
        </div>
        <div class="goods-info">
          <h4>操作记录</h4>
          <table>
            <thead>
              <tr>
                <th>操作者</th>
                <th>操作时间</th>
                <th>订单状态</th>
                <th>付款状态</th>
                <th>描述</th>
                <th>备注</th>
              </tr>
            </thead>
            <tbody>
            <volist name="order.order_action" id="log">
	           	<tr>
	                 <td class="text-center"><if condition="$log.action_user eq 0">管理员<else/>{$log.action_user_name}</if></td>
	                 <td class="text-center">{$log.log_time|date='Y-m-d H:i:s',###}</td>
	                 <td class="text-center">{$order_status[$log[order_status]]}</td>
	                 <td class="text-center">{$pay_status[$log[pay_status]]}<if condition="$order['pay_code'] eq 'code'"><span style="color: red">(货到付款)</span></if></td>
	                 <td class="text-center">{$log.status_desc}</td>
	                 <td class="text-center">{$log.action_note}</td>
	             </tr>
              </volist>
          </table>
        </div>
      </div>
      </form>
  	</div>
  </div>
</div>
<script type="text/javascript">


function delfun() {
	// 删除按钮
	layer.confirm('确认删除？', {
		btn: ['确定'] //按钮
	}, function () {
		console.log("确定");
	}, function () {
		console.log("取消");
	});
}

function pay_cancel(obj){
    var url =  $(obj).attr('data-url');
    layer.open({
        type: 2,
        title: '退款操作',
        shadeClose: true,
        shade: 0.8,
        area: ['45%', '50%'],
        content: url, 
    });
}
//取消付款
function pay_callback(s){
	if(s==1){
		layer.msg('操作成功', {icon: 1});
		layer.closeAll('iframe');
		location.href =	location.href;
	}else{
		layer.msg('操作失败', {icon: 3});
		layer.closeAll('iframe');
		location.href =	location.href;		
	}
}

// 弹出退换货商品
function selectGoods2(order_id){
	var url = "/index.php?m=Admin&c=Order&a=get_order_goods&order_id="+order_id;
	layer.open({
		type: 2,
		title: '选择商品',
		shadeClose: true,
		shade: 0.8,
		area: ['60%', '60%'],
		content: url, 
	});
}    
// 申请退换货
function call_back(order_id,goods_id)
{
	var url = "/index.php?m=Admin&c=Order&a=add_return_goods&order_id="+order_id+"&goods_id="+goods_id;	
	location.href = url;
}
 
</script>
</body>
</html>